package com.gupao.gupaoeduvippattern.javaBase.thread.day01_5;

/**
 * @author Administrator
 * @date 2020-12-06 16:24
 */
public class TestBank {

    public static void main(String[] args) {
        /*Bank bank = new Bank("账号1", 1000);
        SaveBalance saveBalance = new SaveBalance(bank);
        DrawBalance drawBalance = new DrawBalance(bank);
        Thread t1 = new Thread(saveBalance);
        Thread t2 = new Thread(drawBalance);

        t1.start();

        t2.start();*/


        //2
        Bank bank = new Bank("账号1", 1000);
        SaveBalance saveBalance = new SaveBalance(bank);
//        DrawBalance drawBalance = new DrawBalance(bank);
        Thread t1 = new Thread(saveBalance);
        Thread t2 = new Thread(saveBalance);
        Thread t3 = new Thread(saveBalance);

        t1.start();
        t2.start();
        t3.start();

    }


}
